#ifndef _H_DEFS_
#define _H_DEFS_

#include <arpa/inet.h>
#include <linux/if.h>
#include <time.h>

/* 说明请查看指导书。
 */

struct Msg
{
    int length;
    char type;
    char data[4096];
};

#define MSGLENGTH (4101)

typedef struct User_Info_Table
{
    int fd;
    int count;
    time_t secs;
    struct in_addr v4addr;
    struct in6_addr v6addr;
    struct User_Info_Table *pNext;
} User_Info_Table;

typedef struct User_Info_Table * uinfoptr;

struct IPADDR
{
    char addr[32];
    int status;
};

extern struct IPADDR ipaddr[128];
extern int v6sockfd, tun, max_fd;
extern char tun_name[IFNAMSIZ];
extern uinfoptr utable_he;
extern fd_set in_set;
extern const char gu_route[];
extern char gu_dns[3][32];

#endif
